<?php
/* @var $this PageController */
/* @var $model Page */
/* @var $form CActiveForm */
?>
<script src="<?php echo Yii::app()->baseUrl . '/ckeditor/ckeditor.js'; ?>"></script>
<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'page-_page-form',
        // Please note: When you enable ajax validation, make sure the corresponding
        // controller action is handling ajax validation correctly.
        // See class documentation of CActiveForm for details on this,
        // you need to use the performAjaxValidation()-method described there.
        'enableAjaxValidation' => false,
    ));
    ?>


    <?php echo $form->errorSummary($model); ?>

    <div class="form_left">
        <?php echo $form->labelEx($model, 'url'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'url', array('size' => 50, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'url'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'title'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'title', array('size' => 50, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'title'); ?>
    </div>
    <div class="clear"></div>


    <div class="form_left">
        <?php echo $form->labelEx($model, 'meta'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'meta', array('size' => 50, 'maxlength' => 500, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'meta'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'keywork'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'keywork', array('size' => 50, 'maxlength' => 500, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'keywork'); ?>
    </div>
    <div class="clear"></div>
    <?php
    $session = new CHttpSession;
    $session->open();
    if ($session['user_salesmart'][1] > 98) {
        ?>
        <div class="form_left">
            <?php echo $form->labelEx($model, 'flag'); ?>
        </div>
        <div class="form_right">
 
          <?php echo $form->dropDownList($model, 'flag', array('0' => 'Đang ẩn', '1' => 'Đang hiện','2' => 'Hủy')); ?>
        </div>
        <div class="clear"></div>
    <?php } ?>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'content'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'content', array('id' => 'editor1')); ?>
        <?php echo $form->error($model, 'content'); ?>
    </div>
    <div class="clear"></div>
    <div class="clear"></div>
    <div class="row buttons">
        <?php echo CHtml::submitButton('Cập nhật'); ?>
    </div>

    <?php $this->endWidget(); ?>
    <script type="text/javascript">
        CKEDITOR.replace('editor1', {
            filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=files',
            filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=images',
            filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/browse.php?type=flash',
            filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=files',
            filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=images',
            filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder/upload.php?type=flash'
        });
    </script>
</div><!-- form -->